package com.gitee.wsl.doc.prosemirror.state.ext


import com.gitee.wsl.doc.prosemirror.state.EditorState
import com.gitee.wsl.doc.prosemirror.state.Transaction
import com.gitee.wsl.doc.prosemirror.ui.EditorViewModel

fun EditorState.insertText(text: String, from: Int? = null, to: Int? = null): Transaction
   = tr.insertText(text,from,to)

fun EditorViewModel.insertText(text: String, from: Int? = null, to: Int? = null)
        = apply(state.insertText(text,from,to))